<?php
namespace app\admin\controller;


use think\facade\Config;
use app\admin\AdminBase;
use think\facade\Db;
use think\facade\Session;
use think\facade\Cache;
use think\facade\Validate;
use think\exception\ValidateException;

/**
 * 后台登录
 * Class Login
 * @package app\admin\controller
 */
class Home extends AdminBase
{

    /* 后台首页
    * @return mixed
    */
    public function index()
    {
        $version = Db::query('SELECT VERSION() AS ver');
        $config  = [
            'url'             => $_SERVER['HTTP_HOST'],
            'document_root'   => $_SERVER['DOCUMENT_ROOT'],
            'server_os'       => PHP_OS,
            'server_port'     => $_SERVER['SERVER_PORT'],
            'server_soft'     => $_SERVER['SERVER_SOFTWARE'],
            'php_version'     => PHP_VERSION,
            'mysql_version'   => $version[0]['ver'],
            'max_upload_size' => ini_get('upload_max_filesize')
        ];
        return $this->fetch('index',['config'=>$config]);

    }
    /* 清除缓存
    * @return mixed
    */
    public function clearcache(){
        Cache::clear();
        $this->success("清除成功");
    }

}